#include "parallel.h"
#define N 1000

double A[N][N], B[N][N] , C[N][N];
void matrix_multiply(){
    #pragma omp parallel for collapse(2)
    for(int i = 0; i < N; i++){
        for(int j = 0; j < N; j++){//   第一行
            double sum = 0;
            for(int k = 0; k < N; k++){  //
                sum += A[i][k] * B[k][j];
            }
            C[i][j] = sum;
        }
    }
}



int main(){

    for(int i = 0; i < N; i++){
        for(int j = 0; j < N; j++){
            A[i][j] = rand();
            B[i][j] = rand();
        }
    }

    for(int i = 0; i < threads_list_num; i++){
        double start, end; 
        int thread = threads[i]; 
        omp_set_num_threads(thread);
        start = omp_get_wtime(); 
        matrix_multiply();
        end = omp_get_wtime(); 

        printf("thread %d Work took %f seconds\n",thread, end - start);
    }

    // matrix(A, B, C, 4);


}



